{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "59db44de",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "#输入数据\n",
    "import torch\n",
    "#import torch.nn.functional as F\n",
    "x_data = torch.Tensor([[1.0],[2.0],[3.0]])\n",
    "y_data = torch.Tensor([[0],[0],[1]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "b6f88bee",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "#构造模型\n",
    "class LogisticRegressionModel(torch.nn.Module):\n",
    "    def __init__(self):\n",
    "        super(LogisticRegressionModel,self).__init__()\n",
    "        self.linear = torch.nn.Linear(1,1)\n",
    "    def forward(self, x):\n",
    "        y_pred = torch.sigmoid(self.linear(x))\n",
    "        return y_pred \n",
    "model = LogisticRegressionModel()\n",
    "criterion = torch.nn.BCELoss(size_average = False)\n",
    "optimizer = torch.optim.SGD(model.parameters(),lr = 0.01)\n",
    "        \n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "2ecaf7d4",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 3.100217342376709\n",
      "1 3.031827449798584\n",
      "2 2.965721607208252\n",
      "3 2.90191912651062\n",
      "4 2.8404316902160645\n",
      "5 2.7812657356262207\n",
      "6 2.7244203090667725\n",
      "7 2.669889450073242\n",
      "8 2.617659091949463\n",
      "9 2.56770920753479\n",
      "10 2.5200130939483643\n",
      "11 2.4745371341705322\n",
      "12 2.4312422275543213\n",
      "13 2.3900842666625977\n",
      "14 2.35101318359375\n",
      "15 2.3139736652374268\n",
      "16 2.2789065837860107\n",
      "17 2.2457501888275146\n",
      "18 2.2144381999969482\n",
      "19 2.184901714324951\n",
      "20 2.1570708751678467\n",
      "21 2.130873680114746\n",
      "22 2.1062376499176025\n",
      "23 2.083090305328369\n",
      "24 2.0613582134246826\n",
      "25 2.0409698486328125\n",
      "26 2.0218539237976074\n",
      "27 2.0039405822753906\n",
      "28 1.9871622323989868\n",
      "29 1.9714524745941162\n",
      "30 1.9567471742630005\n",
      "31 1.9429850578308105\n",
      "32 1.9301071166992188\n",
      "33 1.9180562496185303\n",
      "34 1.9067785739898682\n",
      "35 1.8962229490280151\n",
      "36 1.8863404989242554\n",
      "37 1.8770850896835327\n",
      "38 1.8684132099151611\n",
      "39 1.8602839708328247\n",
      "40 1.852658748626709\n",
      "41 1.845501184463501\n",
      "42 1.838777780532837\n",
      "43 1.832456111907959\n",
      "44 1.826507568359375\n",
      "45 1.8209037780761719\n",
      "46 1.815618634223938\n",
      "47 1.8106296062469482\n",
      "48 1.805912971496582\n",
      "49 1.8014488220214844\n",
      "50 1.7972173690795898\n",
      "51 1.7932016849517822\n",
      "52 1.7893844842910767\n",
      "53 1.7857508659362793\n",
      "54 1.7822867631912231\n",
      "55 1.7789790630340576\n",
      "56 1.7758152484893799\n",
      "57 1.77278470993042\n",
      "58 1.7698767185211182\n",
      "59 1.7670822143554688\n",
      "60 1.7643922567367554\n",
      "61 1.761798620223999\n",
      "62 1.7592936754226685\n",
      "63 1.756871223449707\n",
      "64 1.7545239925384521\n",
      "65 1.7522470951080322\n",
      "66 1.750034213066101\n",
      "67 1.7478810548782349\n",
      "68 1.7457828521728516\n",
      "69 1.7437353134155273\n",
      "70 1.7417347431182861\n",
      "71 1.7397775650024414\n",
      "72 1.7378602027893066\n",
      "73 1.7359800338745117\n",
      "74 1.7341340780258179\n",
      "75 1.7323198318481445\n",
      "76 1.7305347919464111\n",
      "77 1.7287769317626953\n",
      "78 1.7270442247390747\n",
      "79 1.7253352403640747\n",
      "80 1.7236473560333252\n",
      "81 1.7219798564910889\n",
      "82 1.720331072807312\n",
      "83 1.7186994552612305\n",
      "84 1.717084288597107\n",
      "85 1.7154841423034668\n",
      "86 1.7138981819152832\n",
      "87 1.712325096130371\n",
      "88 1.7107644081115723\n",
      "89 1.7092149257659912\n",
      "90 1.7076764106750488\n",
      "91 1.7061479091644287\n",
      "92 1.7046289443969727\n",
      "93 1.7031185626983643\n",
      "94 1.7016167640686035\n",
      "95 1.7001229524612427\n",
      "96 1.6986362934112549\n",
      "97 1.6971566677093506\n",
      "98 1.6956839561462402\n",
      "99 1.6942172050476074\n"
     ]
    }
   ],
   "source": [
    "#优化模型\n",
    "n = []\n",
    "l = []\n",
    "for epoch in range(100):\n",
    "    y_pred = model(x_data)\n",
    "    loss = criterion(y_pred, y_data)\n",
    "    print(epoch, loss.item())\n",
    "    n.append(epoch)\n",
    "    l.append(loss.item())\n",
    "    \n",
    "    optimizer.zero_grad()\n",
    "    loss.backward()\n",
    "    optimizer.step()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f9f8e40d",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgXklEQVR4nO3de3xU1b338c+PcDdIJESQm0HxhiigQWmpiFRF8K5oq1arR4pUa+Gpp9Wn9rRae06rtmJ9eeURFRQRFTxapbbWS5GjRQOCArEKIshNQgC5WOT2O3+syZMQEzJJZrIze77v12u/Zs/MSuY3bP2yWXvttczdERGRzNcs6gJERCQ1FOgiIjGhQBcRiQkFuohITCjQRURionlUH9yxY0cvLCyM6uNFRDLS3Llz17t7QXXvRRbohYWFFBcXR/XxIiIZycyW1/SeulxERGJCgS4iEhMKdBGRmIisD11EJBV27tzJypUr2b59e9SlpFTr1q3p1q0bLVq0SPpnFOgiktFWrlxJu3btKCwsxMyiLicl3J2ysjJWrlxJz549k/45dbmISEbb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p+4+w7gKeDciGtKOXdf4+7zEvtbCP+DdyV810mJZpOA8yIpMI3MrBtwJvBw4rkBQ4FnE01i9b3NrD0wGJgI4O473H0TWXCsCUtgtjGz5kBbYA0xPNbuPgvYUOXlmo7vucBkD/4B5JlZ0iuQZlqgdwU+q/R8ZeK12DKzQqA/MAfo5O5rEm+tBZrISoYpdTfwM2BP4nk+sMnddyWex+2Y9wRKgUcT3UwPm9l+xPxYu/sq4PfACkKQfwHMJd7HurKajm+DMi7TAj2rmFkuMB0Y5+6bK7/nYbxprMacmtlZwDp3nxt1LY2oOXAc8IC79we2UaV7JabH+gDC2WhPoAuwH1/vlsgKqTy+mRboq4DulZ53S7wWO2bWghDmU9x9RuLlz8v/+ZV4XBdVfWkyCDjHzD4ldKcNJfQv5yX+WQ7xO+YrgZXuPifx/FlCwMf9WJ8KLHP3UnffCcwgHP84H+vKajq+Dcq4TAv0d4HDElfCWxIuorwQcU0pl+g3ngiUuPtdld56Afh+Yv/7wPONXVs6ufv/dfdu7l5IOLavuftlwOvAyESzWH1vd18LfGZmRyRe+jawmJgfa0JXy0Aza5v47738e8f2WFdR0/F9AbgiMdplIPBFpa6Z2rl7Rm3ACOAjYClwc9T1pOk7fovwT7D3gfmJbQShP/lV4GPgb0CHqGtN45/BEODFxP4hwDvAEuAZoFXU9aX4u/YDihPH+7+BA7LhWAO3Ah8CC4HHgVZxPNbAVMJ1gp2Ef5FdXdPxBYwwkm8p8AFhFFDSn6Vb/0VEYiLTulxERKQGCnQRkZhQoIuIxIQCXUQkJhToIiIxoUAXEYkJBbqISEz8L6vNVtlbfCCUAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#画图\n",
    "import matplotlib.pyplot as plt\n",
    "plt.figure()\n",
    "plt.plot(n, l, color = 'blue', linewidth = 2, label = 'loss')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c87d5f44",
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "pytorch"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}